package com.bdqn.pojo;

/**
 * 学生类
 * 
 * @author LILIBO
 * @since 2021-11-24
 */
public class Student {

	/**
	 * 学生编号
	 */
	private Integer id;
	/**
	 * 姓名
	 */
	private String name;
	/**
	 * 性别，0代表女；1代表男
	 */
	private Integer sex;
	/**
	 * 住址
	 */
	private String address;
	/**
	 * 生日
	 */
	private String birthday;

	/**
	 * 无参数的构造方法
	 */
	public Student() {
	}
	
	/**
	 * 有参数的构造方法
	 */
	public Student(String name, int sex, String address, String birthday) {
		this.name = name;
		this.sex = sex;
		this.address = address;
		this.birthday = birthday;
	}
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getSex() {
		return sex;
	}

	public String showSex() {
		return sex==0 ? "女" : "男";
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	/**
	 * 格式化输出
	 */
	public String toString() {
		StringBuffer strbuf = new StringBuffer();
		if (this.getId() != 0) {
			strbuf.append("编号: ").append(this.getId()).append(" ; ");
		}
		strbuf.append("姓名: ").append(this.getName()).append(" ; ");
		strbuf.append("性别: ").append(this.showSex()).append(" ; ");
		strbuf.append("地址: ").append(this.getAddress()).append(" ; ");
		strbuf.append("生日: ").append(this.getBirthday());
		return strbuf.toString();
	}
	
}
